package com.封装.基础;

class People{
    private String name;
    int age;
    private int sex;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }
}
public class Demo1 {
    public static void main(String[] args) {
        People people =new People();
//    people.name ="ss";//报错，private只能在本类中被调用
        people.age = 12;
    }
}
